const NodeRSA = require('node-rsa');
 
const publicKey = `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4lK7E1zQI9rYOZv6ePcVdDh3F 
OaHhceBxtUfi6I59oBxW6Mmc8FIVaOsRraHO9OQBJLZuM+etVWB8Inr4+OC3WcMO 
8oO+irF6hLGaoFHfX5TAfnp75fd4YzdjIqrZRPRe86Uyu2/8cMHu9CTYIdFsr7WA 
xaAJ8N797aNpKk5o5s0IDAQAB 
-----END PUBLIC KEY-----`;
 
function encryptPassword(pwd) {
  const key = new NodeRSA(publicKey, 'pkcs8');
  return key.encrypt(pwd,  'hex');
}
 
const rsaPwd = encryptPassword("111111111111111");
console.log(rsaPwd); 